import {defineConfig} from 'vitepress'
import {resolve} from 'path'
import {sidebar} from './router/index'
import {mdPlugin} from './config/plugins'
// https://vitepress.dev/reference/site-config
export default defineConfig({
    lang: 'zh-CN', // 设置默认语言为中文
    title: "devecoui-plus",
    description: "基于element-plus的Vue3组件库，提供丰富的UI组件和工具，助力快速开发现代化Web应用。",
    themeConfig: {
        siteTitle: false,
        logo: "https://file.wonder-link.net/6e0ea6413d0148e78e5257c2d5c9b365.jpg",
        // https://vitepress.dev/reference/default-theme-config
        nav: [
            {text: '指南', link: '/markdown/guide'},
            {text: '组件', link: '/markdown/components/devFormTable'},
            {text: '方法', link: '/markdown/function/devLocalStorage'},
            {text: '版本记录', link: '/markdown/history'}
        ],
        sidebar,
        socialLinks: [
            {icon: 'gitee', link: 'https://gitee.com/loushouzhang/devecoui/tree/devecoui-plus/'}
        ],
        outline: {
            level: [2, 3], // 显示 h2 和 h3 标题
            label: '导航' // 可选：自定义导航标题
        },
        search: {
            provider: 'local'
        },
        // algolia: {
        //     appId: 'DOR0UUL1O9',
        //     apiKey: '6ccbb45be355024bb824bfb660f19592',
        //     indexName: 'devecoui_com_dor0uul1o9_pages',
        //     placeholder: '搜索文档',
        //     translations: {
        //         button: {
        //             buttonText: '搜索',
        //             buttonAriaLabel: '搜索文档',
        //         },
        //         modal: {
        //             searchBox: {
        //                 resetButtonTitle: '清除查询条件',
        //                 cancelButtonText: '取消',
        //             },
        //         },
        //     },
        // },

    },
    head: [
        // ico 格式
        ['link', {rel: 'icon', href: '/devecoui.svg'}]
    ],
    markdown: {
        config: (md) => mdPlugin(md),
    },
    vite: {
        resolve: {
            alias: {
                '@': resolve(__dirname, '../') // @ 指向 docs/
            }
        },
        server: {
            port: 3815
        },
    }
})
